<style>
#BookReport form{
	width:300px;
}
#BookReport h1.report{
	padding-left:24px;
}
#BookReport form input[type=submit]{
	float:right;
}
#BookReportResult{
	max-width:600px;
	max-height:520px;
	margin-top:2px;
	overflow:auto;
}
#BookReportResult #ArtiklDetails{display:block;}
#BookReportResult #DelatnostDetails{display:none;}
#BookReportResult #UgovorDetails{display:none;}

#BookReportResult table{
	width:100%;
}
#BookReportResult table tr td{
	vertical-align:top;
}
#BookReportResult table tr td .artugovori{
	display:none;
}
#BookReportResult table tr td table{
	border:none;
	width:100%;
	font-size:0.9em;
}
#BookReportResult table tr td table tr td{
	border-right:none;
}
#BookReportResult table tr.sum td{
	font-weight:bolder;
}
#BookReportResult table tr.head:hover{
	background:{{$highlight}};
	color:{{$highlighttext}};
}
#BookReportResult table tr.selected,
#BookReportResult table tr:hover{
	background-color:#dedede;
	color:#000;
}
#BookReportResult table tr td ol{
	margin:0px;
	padding:0px 0px 0px 15px;
}
#BookReportResult table tr td ol li{
	margin:0px;
	padding:0px;
}
#BookReportResult ul.tabs{
	width:100%;
	float:left;
	margin:0px 0px 5px 0px;
	padding:0px 0px 5px 0px;
	list-style-type:none;
	border-bottom:1px solid #ccc;
}
#BookReportResult ul.tabs li{
	display:block;
	float:left;
	margin:0px 1px 0px 0px;
	padding:0px;
}
#BookReportResult ul.tabs li a{
	display:block;
	margin:0px;
	padding:5px 10px;
	text-decoration:none;
	color:#000;
}
#BookReportResult ul.tabs li#current a,
#BookReportResult ul.tabs li a:hover{
	color:{{$highlighttext}};
	background:{{$highlight}};
}
#right_info{
	max-width:500px;
	max-height:538px;
	overflow:hidden;
	margin:2px;
}
#right_info table{
	width:100%;
}
#artikl_ugovor_right{
	overflow:auto;
	max-height:300px;
	margin:0px 0px 0px 2px;
}
#artikl_right{
	overflow:auto;
	max-height:190px;
	margin:2px 0px 0px 2px;
}
#artikl_right table{
	width:auto;
	float:left;
	margin-right:2px;
}
</style>
<div id="BookReport">
	<form class="area" action="javascript:void(0)" onsubmit="submitForm(this,'ugovori.php','POST','setContent',1)">
		<input type="hidden" name="a" value="real_report" />
		<input type="hidden" name="mod" value="book" />
		
		<h1 class="report">Izveštaj za knjigu</h1>
		
		<label class="left" for="kampanja">Kampanja:</label>
		<select name="kampanja" id="kampanja">
			{{%loop start kampanja_id}}
			<option value="{{$kampanja_id}}" {{$kampanja_selected}}>{{$kampanja_name}}</option>
			{{%loop end}}
		</select>
		<br clear="all" />
		
		<fieldset>
			<legend>Datum ugovora</legend>
			<label class="left" for="date_start">Od:</label>
			<input type="text" class="dateInput" name="date_start" id="date_start" value="{{$date_start}}" />
			<input type="button" class="datePicker" onClick="displayDatePicker('date_start',this)" />
			
			<label class="left" for="date_end" style="margin-left:30px">Do:</label>
			<input type="text" class="dateInput" name="date_end" id="date_end" value="{{$date_end}}" />
			<input type="button" class="datePicker" onClick="displayDatePicker('date_end',this)" />
		</fieldset>
		
		<input type="submit" value="filter" />
	</form>
	<br clear="all" />
	<div class="area_white" id="BookReportResult">
		{{$comment_start}}
		<ul class="tabs">
			<li id="current"><a href="javascript:void(0)" onClick="setCurrentLi(this); ShowTab('ArtiklDetails',Array('DelatnostDetails','UgovorDetails'));">po artiklu</a></li>
			<li><a href="javascript:void(0)" onClick="setCurrentLi(this); ShowTab('DelatnostDetails',Array('ArtiklDetails','UgovorDetails'));">po delatnosti</a></li>
			<li><a href="javascript:void(0)" onClick="setCurrentLi(this); ShowTab('UgovorDetails',Array('ArtiklDetails','DelatnostDetails'));">po ugovoru</a></li>
		</ul>
		<br clear="all" />
		<div id="ArtiklDetails">
			<strong>Ukupno artikala: </strong>{{$broj_artikala}}<br />
			<table>
				<tr class="head" align="center">
					<td>artikl</td>
					<td>količina</td>
					<td>broj strana</td>
				</tr>
				{{%loop start artname}}
				<tr onclick="setCurrentTr(this,'class','selected',true); document.getElementById('artikl_ugovor_right').innerHTML = unescape(this.getAttribute('artugovori')); document.getElementById('artikl_right').innerHTML = unescape(this.getAttribute('artmods'))" artugovori="{{$artugovori}}" artmods="{{$artmods}}">
					<td>{{$artname}}</td>
					<td align="center">{{$artnum}}</td>
					<td align="right">{{$pagenum}}</td>
				</tr>
				{{%loop end}}
				<tr class="sum">
					<td align="right">UKUPNO:</td>
					<td align="center">{{$artsum}}</td>
					<td align="right">{{$pagesum}}</td>
				</tr>
			</table>
		</div>
		<div id="DelatnostDetails">
			<strong>Ukupno delatnosti: </strong>{{$broj_delatnosti}}<br />
			<table>
				<tr class="head" align="center">
					<td>delatnost</td>
					<td>količina</td>
					<td>artikli</td>
				</tr>
				{{%loop start delid}}
				<tr>
					<td title="šifra delatnosti:&nbsp;{{$delid}}">{{$delname}}</td>
					<td align="right">{{$delnum}}</td>
					<td>{{$delarts}}</td>
				</tr>
				{{%loop end}}
				<tr class="sum">
					<td align="right">UKUPNO:</td>
					<td align="right">{{$delsum}}</td>
					<td></td>
				</tr>
			</table>
		</div>
		<div id="UgovorDetails">
			<strong>Ukupno ugovora: </strong>{{$sum_ugovora}}<br />
			<strong>Ukupno komitenata: </strong>{{$sum_komitenata}}<br />
			<table>
				<tr class="head" align="center">
					<td>ugovor</td>
					<td colspan="2">komitent</td>
					<td>artikl</td>
					<td>količina</td>
					<td>delatnost</td>
				</tr>
				{{%loop start ugovorid}}
				<tr>
					<td>
						<a href="javascript:void(0)" onclick="blankTarget('LoadRSDoc(\'ugovori.php?a=display&id={{$ugovorid}}\',\'setContent\')')">
							{{$ugovorbroj}}
						</a>
					</td>
					<td>
						<a href="javascript:void(0)" onclick="blankTarget('LoadRSDoc(\'komitenti.php?a=displayOne&id={{$komitentid}}\',\'setContent\')')">
							{{$komitentid}}
						</a>
					</td>
					<td>
						<a href="javascript:void(0)" onclick="blankTarget('LoadRSDoc(\'komitenti.php?a=displayOne&id={{$komitentid}}\',\'setContent\')')">
							{{$komitentname}}
						</a>
					</td>
					<td>{{$artikl}}</td>
					<td align="center">{{$kolicina}}</td>
					<td>{{$delatnost}}</td>
				</tr>
				</tbody>
				{{%loop end}}
			</table>
		</div>
		{{$comment_end}}
	</div>
	<div id="right_info">
		<div class="area_white" id="artikl_ugovor_right"></div><br clear="all" />
		<div class="area_white" id="artikl_right"></div>
	</div>
</div>